home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Environments / PowerMacOberon feb96 / Text / Elem.Guide.Text (.txt) < prev    next >
Encoding:
Oberon Text  |  1995-09-19  |  38.9 KB  |  396 lines  |  [TEXT/.Ob4]

  1. Syntax12.Scn.Fnt
  2. ParcElems
  3. Alloc
  4. Syntax14m.Scn.Fnt
  5. Syntax10.Scn.Fnt
  6. StampElems
  7. Alloc
  8. 19 Sep 95
  9. Syntax12m.Scn.Fnt
  10. Syntax12i.Scn.Fnt
  11. Syntax12b.Scn.Fnt
  12. LineElems
  13. Alloc
  14. TableElems
  15. Alloc
  16. Syntax10.Scn.Fnt
  17. Syntax10i.Scn.Fnt
  18. /left 0/right 0/nohead "*"/noline "*"/col "LL"/table
  19. /columns  string
  20. Syntax10.Scn.Fnt
  21. ParcElems
  22. Alloc
  23. /left 0/right 0/nohead "*"/noline "*"/col "LL"/table
  24. control column formatting
  25. string = {L|C|R|N|-}.
  26. Syntax10.Scn.Fnt
  27. ParcElems
  28. Alloc
  29. /left 0/right 0/nohead "*"/noline "*"/col "LL"/table
  30. L    left flush
  31. C    centered
  32. R    right flush
  33. N    numeric (period adjusted)
  34. -    default
  35. Syntax10.Scn.Fnt
  36. Syntax10i.Scn.Fnt
  37. /left 0/right 0/nohead "*"/noline "*"/col "LL"/table
  38. /rows  string
  39. Syntax10.Scn.Fnt
  40. ParcElems
  41. Alloc
  42. /left 0/right 0/nohead "*"/noline "*"/col "LL"/table
  43. control row formatting
  44. string = {B|L|C|T|-}.
  45. Syntax10.Scn.Fnt
  46. ParcElems
  47. Alloc
  48. /left 0/right 0/nohead "*"/noline "*"/col "LL"/table
  49. B    bottom flush
  50. L    common baseline
  51. C    centered
  52. T    top flush
  53. -    default
  54. Syntax10.Scn.Fnt
  55. Syntax10i.Scn.Fnt
  56. /left 0/right 0/nohead "*"/noline "*"/col "LL"/table
  57. /noheads  string
  58. Syntax10.Scn.Fnt
  59. ParcElems
  60. Alloc
  61. /left 0/right 0/nohead "*"/noline "*"/col "LL"/table
  62. turn header lines off
  63. string = {H|V |*}.
  64. Syntax10.Scn.Fnt
  65. ParcElems
  66. Alloc
  67. /left 0/right 0/nohead "*"/noline "*"/col "LL"/table
  68. H    horizontal
  69. V    vertical
  70. *    all
  71. Syntax10.Scn.Fnt
  72. Syntax10i.Scn.Fnt
  73. /left 0/right 0/nohead "*"/noline "*"/col "LL"/table
  74. /nolines  string
  75. Syntax10.Scn.Fnt
  76. ParcElems
  77. Alloc
  78. /left 0/right 0/nohead "*"/noline "*"/col "LL"/table
  79. turn separation lines off
  80. string = {L|R|B|T|H|V|*}.
  81. Syntax10.Scn.Fnt
  82. ParcElems
  83. Alloc
  84. /left 0/right 0/nohead "*"/noline "*"/col "LL"/table
  85. L    left frame
  86. R    right frame
  87. B    bottom frame
  88. T    top frame
  89. H    horizontal separation
  90. V    vertical separation
  91. *    all
  92. Syntax10.Scn.Fnt
  93. ParcElems
  94. Alloc
  95. Syntax10i.Scn.Fnt
  96. /left 0/right 0/nohead "*"/noline "*"/table
  97. /period  string
  98. /left  integer
  99. /right  integer
  100. /bottom  integer
  101. /top  integer
  102. /grid  integer
  103. Syntax10.Scn.Fnt
  104. ParcElems
  105. Alloc
  106. /left 0/right 0/nohead "*"/noline "*"/table
  107. first char redefines period (e.g. ",")
  108. left cell margin
  109. right cell margin
  110. bottom cell margin
  111. top cell margin
  112. cell width grid *)
  113. Documentation of Text Elements for Oberon
  114. Last Update: 
  115. Table of Contents
  116.         Element Class    Author
  117.         Balloon    H. M
  118. ssenb
  119.         Clock    M. Franz
  120.         Dialogs    M. Knasm
  121.         Directory    H. M
  122. ssenb
  123.         Error    M. Hausner
  124.         Fold    H. M
  125. ssenb
  126.         Font    H. M
  127. ssenb
  128.         Graphic    C. Szyperski
  129.         Handler    H. M
  130. ssenb
  131.         Icon    R. Griesemer
  132.         Info    C. Steindl    
  133.         Line    C. Szyperski
  134.         Link    H. M
  135. ssenb
  136.         Mark    H. M
  137. ssenb
  138.         Index    M. Hof
  139.         Popup    M. Franz    
  140.         Stamp    C. Szyperski
  141.         Style    C. Szyperski
  142.         Table    C. Szyperski
  143.         Version    H. M
  144. ssenb
  145. This documentation is a periodically updated collection of sections describing fully independent text elements. Each section is divided into two subsections: A textual introduction to the functionality of the particular elements, followed by a list of supported commands. For each command, the command name, its explicit and its implicit parameters are given. Potential implicit parameters are the caret, selections, the marked viewer, or the command viewer (i.e. the one from where the command was issued). Explicit parameters are described using a compact syntax explained in the tutorial Edit.Guide.Text .
  146. Companion documentation:
  147.     Edit.Open Edit.Guide.Text - Tutorial and Release Notes
  148. Balloon Elements
  149. Balloon elements offer balloon help (i.e., popup explanations) in texts. A balloon element contains a dictionary of names and their explanations (see below). The explanations can pop up on demand.
  150.     Module BalloonElems also defines a frame handler that - if installed in text frames - produces the following behavior: when the user clicks at a name in this frame with the middle and right mouse button the name is looked up in the first balloon element of this frame's text (if the name is imported, it is looked up in the balloon elements of the imported module's text). If the name is found, the corresponding explanation is shown in a popup window as long as the right mouse button is pressed. If it is not found, it is looked up in a default dictionary named "Balloon.Text". If not found, the module name in the viewer's menu is prepended to the name before it is looked up in "Balloon.Text" again. If it is still not found there, the click is passed to the default handler of text frames. The custom handler is automatically installed when BalloonElems is loaded (see module HandlerElems to learn about the installation of custom handlers).
  151. Dictionary format
  152. Since a balloon element is an extension of a popup element, its dictionary is stored as the menu text of the popup element. It can be opened for editing with a middle-right click on the element. The dictionary has the format:
  153.     Dictionary = {Name Explanation}.
  154.     Name = string.
  155.     Explanation = any text up to the next string or to the end of the file.
  156. Example dictionary:
  157.     "Elem"
  158.     A balloon element containing a dictionary of
  159.     words and their explanations.
  160.     "Other" 
  161. command    explicit parameters    implicit parameters
  162. BalloonElems.Insert        caret
  163. inserts an empty balloon element at the caret position.
  164. BalloonElems.Install
  165. explicitly loads the module BalloonElems thus installing the handler in module HandlerElems.
  166. BalloonElems.LoadDictionary
  167. reloads the dictionary "Balloon.Text" after it has been modified.
  168. Procedures
  169. - Popup (dict, beg, end) shows the stretch [beg..end[ from dict in a popup window as long as the right mouse button is pressed.
  170. - FrameHandler (f, m) is a custom handler that intercepts middle+right mouse clicks at some name and looks up the name in the dictionaries as explained above. This handler is defined as the current handler in HandlerElems during module initialization. Thus it is automatically installed in all frames that contain a handler element in their menu text.
  171. Clock Elements
  172. Analog clocks elements displaying the current time (whenever the machine is idle).
  173. command    explicit parameters    implicit parameters
  174. ClockElems.Insert    [number]    caret
  175. Insert a clock (with radius given in pixels, default is 32, minimum is 12) at the caret position.
  176. Dialog Elements
  177. Dialog elemts support incorporation of panels compatible with the Dialogs package into texts. The command DialogElems.Insert inserts a new dialog element into a text at the text caret position. Using the middle mouse button, a dialog element can be "opened" for editing in a dialog viewer. The command DialogElems.Update in the viewer
  178. s menu can be used to make the modifications in the dialog permanent. Dialog elements can be used like ordinary dialogs: focus the element using the left mouse key and do everything what you would do with an ordinary dialog.
  179. command    explicit parameters    implicit parameters
  180. DialogElems.Insert    ("^" | "*" | name)    caret (plus marked viewer, if "*" is used)
  181. Inserts a dialog element sized to show the dialog stored in file "name". If a dialog viewer is marked, the command inserts the dialog of this viewer.
  182. Directory Elements
  183. Directory elements allow a user to conveniently switch between working directories. These elements are derived from popup elements and always show the current working directory. Note: these elements are currently only available on the Power Macintosh.
  184. User interaction. A middle click at a directory element pops up a list of path names, e.g., HD:Oberon:MyFolder (an absolute path name) or $Source (a relative path name starting in the directory that contains the Oberon application). By selecting one of the menu items the current working directory is switched to that path and is displayed in the directory element. If the selected menu item is "^", the directory path is taken from the most recent selection. The menu can be edited after a middle-right click at the element (in the same way as in popup elements).
  185. command    explicit parameters    implicit parameters
  186. DirElems.Insert        caret
  187. inserts a directory element at the caret position. 
  188. Error Elements
  189. Error elements can be used to translate error lists produced by a compiler into special marking elements within the source text. Since elements move when editing text, it becomes possible to edit a large number of errors at a time. Error elements are temporary elements and hence vanish automatically when storing a marked text.
  190. By clicking on a error element using MM, the element may be toggled between its (initial) compact form and its full form. In the compact form, it displays the error number. In the full form, the element displays the corresponding error message. In order for this function to work properly, the files Syntax8.Scn.Fnt and OberonErrors.Text are required. The latter contains the error code/error message pairs.
  191. command    explicit parameters    implicit parameters
  192. ErrorElems.Mark    ("^" | error-list)    marked viewer
  193. Takes the list of errors produced by a compiler (position, error code pairs) and inserts error marks into the marked text. If error marks were already present in that text, they are removed beforehand.
  194. ErrorElems.Unmark        marked viewer
  195. Remove all error elements from the marked text.
  196. ErrorElems.LocateNext        marked viewer, caret (in marked viewer)
  197. Locate the next error element starting the search at the caret position. If no caret is set in the marked viewer, the first error element is located.
  198. Fold Elements
  199. Fold elements can be used to hierarchically fold text pieces. Folding a text piece causes its replacement by another, usually shorter or empty text piece. Unfolding a folded text piece reveils the original text piece while hiding its replacement. A (partially) folded text may be compiled as if it where fully unfolded using a utility module Folds. Folds also includes the functionality of ErrorElems, as defined elsewhere in this documentation.
  200. command    explicit parameters    implicit parameters
  201. FoldElems.Insert        selection
  202. Makes the selection foldable by inserting a pair of fold elements around it. The fold elements are in expanded state.
  203. FoldElems.InsertCollapsed        selection
  204. Makes the selection foldable by inserting a pair of fold elements around it. The fold elements are in collapsed state.
  205. FoldElems.Expand        marked viewer or command viewer
  206. Unfolds (expands) all folds in the specified viewer.
  207. FoldElems.Collapse        marked viewer or command viewer
  208. Folds (collapses) all folds in the specified viewer.
  209. FoldElems.Marks     ("^" | "on" | "off")    marked viewer or command viewer
  210. Makes all fold elements in the specified viewer visible or invisible.
  211. FoldElems.Search        selection, focus viewer    
  212. Searches for the selected text pattern in the text of the focus viewer starting at the caret position. It searches also within folded parts and opens folds if necessary to display occurrences of the pattern. If no selection exists, the last search pattern is used again. If no caret is set, the search starts at the beginning of the text.
  213. FoldElems.Restore        marked viewer or command viewer
  214. Restores all folds that were expanded during a FoldElems.Search command to their previous state.
  215. Folds.Compile    ("*" [compiler-options])    marked viewer or command viewer
  216. Compiles the marked text containing folds. The compiler is started on the fully expanded view of the text.
  217. Folds.ShowError        [caret]
  218. Shows the next error after the caret position. If no caret is set, the first error in the text is displayed.
  219. Procedures
  220. ExpandAll(t, from, temp) expands all fold elements in text t if they are after the text position from. If temp is TRUE, the folds are only expanded temporarily and can be collapsed again with FoldElems.Restore.
  221. CollapseAll(t, modes) collapses all fold elements in text t if they are of a kind that is contained in the set modes.
  222. FindElem(t, pos, proc, e) searches text t starting at position pos. For every encountered text element procedure proc is invoked. If this procedure returns TRUE, the element is returned by FindElem as e.
  223. Switch(e) switches the fold element e from collapsed to expanded or vice versa.
  224. Twin(e) If (e, x) is a pair of fold elements, Twin(e) returns x.
  225. Font Elements
  226. Font elements allow a user to conveniently set the font family, font size and font style of a piece of text. They are derived from popup elements.
  227. User interaction. A middle click at a font element pops up a list of font families (e.g., Syntax, Courier, Math, ...), font sizes (e.g., 10, 12, 14, ...), and font styles (plain, bold, italic). The selected text stretch will get the family, size or style chosen from the font menu. Other attributes of the text stretch remain the same. The list of families, sizes and styles can be edited after a middle-right click at the element (in the same way as in popup elements).
  228. command    explicit parameters    implicit parameters
  229. FontElems.Insert        caret
  230. inserts a font element at the caret position (preferably in the menu of a viewer). 
  231. Hint. It is a good idea to insert a font element in Edit.Menu.Text so that font selection is available in every text viewer.
  232. Graphics Elements
  233. Graphic elements support incorporation of graphs compatible with the standard Draw package into texts. A single command is provided by module GraphicElems in order to insert a new graphics. Using the middle mouse button, a graphics element can be "opened" for editing. As a result, a graphics viewer is opened displaying the graph. The command GraphicElems.Update in the viewer's menu can be used to propagate changes made to the graph back to the graphics element. Graphic elements support inplace editing: focus the element using the left mouse key and use standard Draw editing techniques within the activated graphics frame.
  234. command    explicit parameters    implicit parameters
  235. GraphicElems.Insert    ("^" | "*" | name)    caret (plus marked viewer, if "*" is used)
  236. Inserts a graphics element sized to show the graph stored in graphics file "name". If an open graphics viewer is marked, the command can be used to insert all or part of a displayed graph: if a selection exists in the marked graphics viewer's graph, only the selection is copied into the graphics element.
  237. Handler Elements
  238. Module HandlerElems allows a user to define a current handler. This handler is automatically installed in all text frames whose menu contains a handler element. Thus it is possible to intercept messages to text frames and to react to them in a specific way.
  239.     Custom handlers typically handle only a few messages and forward others to the standard handler TextFrames.Handle. They can also be cascaded so that the current handler forwards messages to the previously installed handler and so on until the message finally gets to TextFrames.Handle (see procedure SetHandler below).
  240. command    explicit parameters    implicit parameters
  241. HandlerElems.Insert        caret
  242. inserts a handler element at the caret position (should be in a menu frame).
  243. HandlerElems.ListHandlers
  244. prints a list of all handlers installed with SetHandler. This is useful to see which handlers are currently installed.
  245. HandlerElems.ResetHandlers
  246. resets the current handler to TextFrames.Handle.
  247. Procedures
  248. - SetHandler (name, new, old) sets the current handler to new. The caller of SetHandler is expected to give a name for new (to be used by ListHandlers). On exit, old contains the previously installed  handler. This can be used to make new forward messages to old.
  249. Hints
  250. - It is a good idea to add a handler element to Edit.Menu.Text so that all text viewers will contain it in the future. Since a handler element looks exacly like a popup element, one of the popup elements in Edit.Menu.Text can be replaced by a handler element.
  251. Icon Elements
  252. Display a small "walking sysiphus" icon. By clicking on such an icon using MM, a screen saver is started. Using an icon editor, the file IconElems.Icon may be changed or replaced to install a different animated icon.
  253. command    explicit parameters    implicit parameters
  254. IconElems.Insert        caret
  255. Inserts a new Icon Element at the caret position.
  256. File required: IconElems.Icon
  257. Info Elements
  258. Info elements are similar to popup menus. When clicking on the element with the middle mouse button, it responds by showing a text. This text contains additional information about the text in which the element is inserted. A typical application is a source module where you would like to add some informations about the programmer and the programming task to the document.
  259. command    explicit parameters    implicit parameters
  260. InfoElems.Insert        caret
  261. Inserts a new Info Element at the caret position.
  262. Hints
  263. The module Find exports a command called AllInfo which can be very useful in combination with InfoElems:
  264. Find.AllInfo ^
  265. searches within the InfoElems of the files specified with Find.Domain. The selection must be of the form item = searchPattern where item is one of {"Title", "Author", "Abstract", "Keywords", "Version", "From", "Until", "Hints", "Changes"}, searchPattern must match exactly or contain asterisks.
  266. E.g.: Find.AllInfo Author = *CS*
  267. Contents of a new InfoElem:
  268. "Title": no title
  269. "Author": no name
  270. "Abstract": no abstract
  271. "Keywords:": no keywords
  272. "Version": no version
  273. "From":  28.10.94 16:59:45
  274. "Until": no date (use StampElems.Insert)
  275. "Hints": This text can again contain arbitrary text elements!
  276. Line Elements
  277. Line elements support horicontal or vertical lines within a text. A single command is provided to insert new line elements. The insertion command takes certain parameters such that line elements can be set to automatically adapt in width and height.
  278. command    explicit parameters    implicit parameters
  279. LineElems.Insert    ("^" | ( ("auto" | "tab" | W) ("auto" | H) ) )    caret
  280. Inserts a line of given or automatically adopted width and height into a text. Width and height may be set in units of 1/10 mm. Otherwise, the width may be set to extend to the end of the current line ("auto") or to the next tabulator position ("tab"). The height may be set to equal the paragraphs line height (determined by the parc's line attribute).
  281. Link Elements
  282. This module provides two kinds of text elements: link elements and link menus.
  283. - A link element represents a hypertext link to a mark element (MarkElems). When the user middle-clicks at the link element the text around the associated mark element is displayed. A middle click at the mark element leads one back to the link element.
  284. - A link menu is an extension of a popup element (PopupElems). It can be used in the menu bar of a viewer. When the user clicks at a link menu, a list of all mark elements in the viewer pops up. By selecting an entry the user can get to any of the mark elements quickly. The list of marks is collected automatically.
  285.         For example, the user can invoke the command MarkElems.MarkProcs to insert mark elements in front of all procedure names in procedure declarations. The link menu will then show all these mark elements and the procedure names following them in the text. Of course the user can also insert mark elements explicitly (e.g., in front of type names or variable names). These marks will also be shown in the link menu together with the names following them in the text.
  286. User interaction. A middle click at a link element displays the text around the associated mark element. If the mark element is in the same text as the link element, the text is scrolled to the mark element's position. If it is in a different text, a new viewer is opened showing the mark element and its surrounding text.
  287.     A middle-right click at a link element opens a viewer showing the value of the link target (expressed by the tuple <destination file name, mark key>). This text can be edited and stored back to the element with LinkElems.Update from the viewer's menu.
  288.     A middle click at a link menu pops up a list of all marks in the viewer's text. By selecting a specific entry the text is scrolled to that mark.
  289. command    explicit parameters    implicit parameters
  290. LinkElems.Insert        caret
  291. inserts a link element at the caret position. The target point of the link is taken from the most recent selection. If a mark element is selected the link goes to that mark element otherwise a new mark element is inserted at the beginning of the selection.
  292. LinkElems.InsertMenu        caret
  293. inserts a link menu at the caret position. Link menus should only be used in the menu bar of a viewer.
  294. LinkElems.Update
  295. updates an edited <file name, key> value. See also "middle-right click" above.
  296. Procedures
  297. New(f, k) creates and returns a link element that leads to the mark element with the key k in file f.
  298. FollowLink(f, k, lf, le) follows as link to a mark element with the key k in file f. The frame containing the link element must be given in lf and the link element itself in le. These two parameters are used to establish a backwards link.
  299. It is a good idea to insert a link menu in Edit.Menu.Text, so that a list of all marks can be popped up in all text viewers.
  300. Mark Elements
  301. Mark elements mark a certain position in a text. They are typically used as the target of hypertext links (LinkElems) or as bookmarks. They can be referenced via a numeric key.
  302. User interaction. If one got to a mark element by following a hypertext link, a middle click at this element will lead one back to the source of the link, i.e., to the corresponding link element. A middle+right click will open a viewer showing the element's key. The key can be edited and stored back to the element with MarkElems.Update from the viewer
  303. s menu. This may be useful in rare cases to resolve key ambiguities.
  304. command    explicit parameters    implicit parameters
  305. MarkElems.Insert        caret
  306. inserts a mark element with a new key at the caret position. 
  307. MarkElems.Update
  308. updates an edited key value. See also "middle click" above.
  309. MarkElems.ShowNext        caret
  310. searches for the next mark element after the caret position and sets the caret to it.
  311. MarkElems.MarkProcs        marked viewer
  312. inserts mark elements in front of all procedure declarations in the marked viewer. This is useful in the context of link menus (see LinkElems.Menu) which automatically create links to all mark elements in a text.
  313. Procedures
  314. New() returns a new and initialized mark element that has not been inserted into a text yet.
  315. Index Elements
  316. Index elements work similar to mark elements. They also mark a text position which may be used as the target of hypertext links (LinkElems) or as bookmarks. The added functionality is their ability to automatically create an index of the corresponding text.
  317. User interaction. A middle click will open a viewer showing the text associated with this element. The associated text can be edited and stored back to the element with IndexElems.Update resp. MarkElems.Update from the viewer menus. 
  318. command    explicit parameters    implicit parameters
  319. IndexElems.Insert        caret
  320. inserts an index element with a new key at the caret position. The current selection is taken as the associated text. If there is no current selection, the associated text is empty. 
  321. IndexElems.Update
  322. updates the edited associated text. See also "middle click" above.
  323. IndexElems.Hide        marked viewer
  324. hides all index elements in the marked viewer.
  325. IndexElems.Show        marked viewer
  326. redisplays all index elements in the marked viewer.
  327. IndexElems.Index        server-name "*" {option}
  328. Generates an Index for the marked viewer. As a side effect, text is printed as well. For a detailed description of available options read the information on Edit.Print. The index is displayed in a separate viewer. It has the following format:  <associated text> tab pagenumber <Link Element> {"," pagenumber <Link Element>}.
  329. Popup Elements
  330. Popup elements respond to a middle mouse click by showing a text of lines (usually commands) that can be selected (executed) by moving the mouse up and down. The default behavior is to interpret the selected line as a command and execute it. Oberon.Par is initialized with the viewer and the frame containing the menu as well as with the menu text and the position of the command in this text. 
  331.     If the menu contains just a single line it does not pop up but this line is selected by default. If the user clicks at the menu without moving the mouse the most recently selected line is assumed to be still selected.
  332.     If the selected line starts with another element (e.g., a link element) this element receives a middle-click message, i.e., it is executed.
  333. Editing a menu. A middle+right click at a popup element opens a viewer that displays the menu text. This text can be edited (commands can be added or removed) and stored back to the element by executing the command PopupElems.Update from the menu bar of the viewer. The menu name can be changed by editing the name of the edit viewer.
  334. command    explicit parameters    implicit parameters
  335. PopupElems.Insert     (name | string | ^)
  336. inserts a popup menu at the caret position. The command argument specifies the menu name.
  337. PopupElems.InsertMenu    (name | string | ^)
  338. inserts a small popup menu at the caret position. The height of a small menu is chosen such that the menu fits into the menu bar of a viewer. The command argument specifies the menu name.
  339. PopupElems.Toggle
  340. If executed from the menu bar of the menu edit viewer, the command toggles between a small and a large menu element.
  341. PopupElems.Update
  342. can be executed from the menu bar of the menu edit viewer. It stores the text in this viewer as the menu text of the edited popup menu.
  343. Procedures
  344. - MeasureMenu(m) computes the metrics of the popup window for the menu text. This procedure has to be called whenever the menu text has been modified.
  345. Hints for implementors of subclasses
  346. - Intercepting the menu selection: In subclasses of popup menus the menu selection can be intercepted by reacting to the execute message (ExecMsg) that is sent to the menu when one of its lines is selected. This message contains the position (origin) of the selected line in the menu text.
  347. - Popup menus with icons: A popup element usually displays a string (its name). If this string is empty an empty element box is drawn. A subclass of popup elements can then draw an icon into the menu box.
  348. Stamp Elements
  349. Displays the date of the most recent store operation on the text containing the element. (After insertion, StampElems display the current date.) The insert command takes an optional font name which is used to preset the font of the inserted element.
  350. command    explicit parameters    implicit parameters
  351. StampElems.Insert    [name]    caret
  352. Inserts a new stamp element, where the name indicated the font to be used. (If name is omitted, the default font is used.)
  353. Style Elements
  354. Style Elements extend standard Parcs by adding a name and automatic conformance of equally named parcs within a text. For example, a parc named "heading" may be set to format a section heading. Then, all parcs with that name use and maintain the same format as changes are propagated automatically.
  355. When copying a style parc from one text to another the behaviour of the copied parc depends on the target text. If it already contains a style with that name, the copied parc will adopt itself to that style. Otherwise, the copied parc defines a new style. Likewise, a style parc may be renamed. If it is renamed to a style that already exists in the containing text, the parc will adopt to that style, while otherwise it introduces a new style.
  356. Some examples for style parcs follow below. Note that the Syntax8.Scn.Fnt file should be available to get nicely labled style parcs.
  357. command    explicit parameters    implicit parameters
  358. StyleElems.Insert    ("^" | name | string)    caret
  359. Insert a new style parc with the given name at the caret position. A quoted string may be used to assign names consisting of multiple words.
  360. StyleElems.Rename    ("^" | name | string)    selected parc
  361. Renames the selected parc to the given name.
  362. Table Elements
  363. Table Elements are automatically formatted tables created from raw, unformatted data. A plain text separated by tabulator characters into columns and by carriage returns into rows can be used to define the table. Furthermore, a certain set of options may be used to modify the default formatting of the table.
  364. Clicking on a table element using MM opens an viewer such that the table contents can be edited. Tables may contain arbitrary text elements, including tables. However, elements incorporated into a table are frozen as is, i.e. messages broadcasted to all visible elements in a text frame are not passed to elements nested into a table. Hence, only static elements should be inserted into tables.
  365. Starting from a defining text containing arbitrary strings separated by tabulator and carriage-return characters, a table is constructed. Tabulators separate columns, carriage-returns separate rows. The separated strings form the contents of table cells. Each such string may in turn contain arbitrary text elements and especially it may contain nested tables. The defining text is bound to a table element and can be edited by clicking on a table with the middle mouse button. In return, a standard text viewer is opened containing an update command in its menu bar. The syntax of the defining text is as follows, table options will be defined later.
  366.     table = {option} "/table" {line}.
  367.     line = cell {TAB cell} CR.
  368.     cell = ["#" | "&"] <string of characters not containing TAB or CR>.
  369. A string starting with a digit, a period (.), or a sign (+ or -) is considered numeric, otherwise it is considered nonnumeric. A number sign (#) prefixing a string is suppressed and enforces numerical interpretation; likewise, an ampersand (&) prefixing a string is suppressed and enforces nonnumerical interpretation. The default table formatting causes all cells in the first column to be formatted left flush. In all other columns, the default format for numeric cells is period-aligned and that for nonnumeric cells is centered. All cells in a row are by default aligned to a common base line. Also, the default format causes the table to be framed and separating lines between rows and columns to be drawn. Finally, for a table with more than two rows or two columns the first row or column separatation line is drawn using two parallel lines, respectively. Most of the default formats can be changed using the provided option set.
  370. For table elements the printing dilemma discussed in section 1.5 needs to be reconsidered. Following the strategy developed for texts, a table would be recasted when printing. However, one of the primary attributes of a table are its measures, i.e. the space taken for individual cells of the table and the arrangement of the cells with respect to each other. It is not acceptable that a table gets completely redimensioned when printed. Hence, for table elements a different printing strategy has been choosen: the displayed table on the screen follows - down to the character level - the metrics of the printer fonts. The resulting screen image looks a bit distorted, however, the displayed measures correspond as closely as possible to the printed ones.
  371. The following table gives an overview over available table formatting options.
  372. option    effect (measures in 1/10 mm)    argument values
  373. *)  A parc at the beginning of the table defining text introduces a minimal
  374.      cell height as well as a cell height grid (if the grid option of the parc is set)
  375. Overview of TableElems Options
  376. command    explicit parameters    implicit parameters
  377. TableElems.Insert    ["^" | name]    caret
  378. Insert a table defined by the given text at the caret position. If no defining file is given, or the table definition is syntactically erroneous, an empty table is inserted.
  379. TableElems.Update    (to be called from menu frame)
  380. Take the viewer's content frame's text as defining text and update the associated table element.
  381. Version Elements
  382. Version elements simplify the handling of multiple versions of a module in the same source file. Text pieces that differ from one version to the other are enclosed in version elements which look like angle brackets. When the user middle-clicks on the opening bracket a popup menu with a list of version names appears. Selecting one of the names replaces the bracketed text with the text that is stored for the selected version.
  383. Example: Assume that we have two versions of a module: one for Windows and one for the Mac. In the Windows version a declaration might read
  384.     CONST delimiter = "\";
  385. while in the Mac version it should read
  386.     CONST delimiter = ":";
  387. Select the declaration text in the Windows version and execute VersionElems.Insert Windows. This will insert version elements around the selection. Now middle-right click on the opening bracket. Since this bracket is derived from a popup element, an edit viewer will be opened showing the text "Windows". Add a new line with the text "Mac" and click PopupElems.Update. A middle-click on the opening bracket now shows a popup menu with the two entries "Windows" and "Mac". Select "Mac". The text between the brackets disappears and you can enter the declaration as it should be in the Mac version. You can switch between the two versions using the popup menu as described above.
  388.     When you select a version from the popup menu, all version elements in the text will switch to this version. Alternatively you can use VersionElems.SetVersion Windows to set the version of all version elements to Windows.
  389. command    explicit parameters    implicit parameters
  390. VersionElems.Insert    versionName    selection
  391. inserts a pair of version elements around the current selection. 
  392. VersionElems.SetVersion    versionName    marked viewer
  393. switches all version elements in the marked viewer to the specified version.
  394. VersionElems.Find        caret
  395. sets the caret to the next version element after the previous caret position.
  396.